package com.geekaca.d4.d3;

import java.time.LocalDate;
import java.time.Period;

public class TestPeriod {
    public static void main(String[] args) {

        // 当前木地年月是
        LocalDate today = LocalDate.now();
        System.out.println(today);
        // 生日的 年月日
        LocalDate birthDate = LocalDate.of(1981, 12, 26);
        System.out.println(birthDate);
        /**
         * 你已经出生多少天了
         */
        Period period = Period.between(birthDate, today);
        System.out.println(period);
        System.out.println("你从出生到现在经过了: " + period.getYears() + "年" + period.getMonths() + "月" + period.getDays() + "日");
    }
}
